package com.lcp.utils;

import javafx.scene.control.ButtonType;
import javafx.scene.control.Dialog;

/**
 * @author: Administrator
 * @date: 2021/01/22 15:31
 * @description:
 */
public class InfoUtil {
    public static void showAlert(String message) {
        System.out.println(message);
        Dialog<Void> alert = new Dialog<>();
        alert.getDialogPane().setContentText(message);
        alert.getDialogPane().getButtonTypes().add(ButtonType.OK);
        alert.showAndWait();
    }
    public static boolean showConfirm(String message) {
        Dialog<ButtonType> confirm = new Dialog<>();
        confirm.getDialogPane().setContentText(message);
        confirm.getDialogPane().getButtonTypes().addAll(ButtonType.YES, ButtonType.NO);
        boolean result = confirm.showAndWait().filter(ButtonType.YES::equals).isPresent();
        return result ;
    }
}
